package com.apiit.webserviceclient.activities;

import java.util.HashMap;
import java.util.Map;

import com.apiit.webserviceclient.R;
import com.apiit.webserviceclient.R.layout;
import com.apiit.webserviceclient.R.menu;
import com.apiit.webserviceclient.utility.BPEL_Process;
import com.apiit.webserviceclient.utility.BPEL_Request;
import com.apiit.webserviceclient.utility.BPEL_Response;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class AllCourses extends Activity implements OnClickListener {

	Button Foundation;
	Button LevelI;
	Button LevelH;
	Button LevelC;
	Button postgraduate;
	Button Miscellaneous;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_all_courses);

		Foundation = (Button) findViewById(R.id.btnLmsFoundation);
		LevelI = (Button) findViewById(R.id.btnLmsLevelI);
		LevelH = (Button) findViewById(R.id.btnLmsLevelH);
		LevelC = (Button) findViewById(R.id.btnLmsLevelC);
		postgraduate = (Button) findViewById(R.id.btnLmsPostgraduate);
		Miscellaneous = (Button) findViewById(R.id.btnLmsMiscellaneous);

		Foundation.setOnClickListener(this);
		LevelI.setOnClickListener(this);
		LevelH.setOnClickListener(this);
		LevelC.setOnClickListener(this);
		postgraduate.setOnClickListener(this);
		Miscellaneous.setOnClickListener(this);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.all_courses, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == Foundation) {
			BPEL_Process bpelProcess = new BPEL_Process();
			BPEL_Request request = new BPEL_Request();
			String url_lib_auth = "http://lms.apiit.lk/course/index.php?categoryid=11";
			request.setUrl(url_lib_auth);

			Map<String, String> xpathMap = new HashMap<String, String>();
			xpathMap.put("course1","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course2","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[2]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course3","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[3]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course4","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[4]/div[1]/h3[1]/a[1]---");
		    xpathMap.put("course5","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[5]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course6","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[6]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course7","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[7]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course8","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[8]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course9","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[9]/div[1]/h3[1]/a[1]---");

			request.setXpathMap(xpathMap);
			Map<String, String> parametersMap = new HashMap<String, String>();

			request.setParametersMap(parametersMap);
			request.setType("GET");
			BPEL_Response respones = null;
			try {
				respones = bpelProcess.doRequest(request);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			String course1 = respones.getResultsMap().get("course1");
			String course2 = respones.getResultsMap().get("course2");
			String course3 = respones.getResultsMap().get("course3");
			String course4 = respones.getResultsMap().get("course4");
			String course5 = respones.getResultsMap().get("course5");
			String course6 = respones.getResultsMap().get("course6");
			String course7 = respones.getResultsMap().get("course7");
			String course8 = respones.getResultsMap().get("course8");
			String course9 = respones.getResultsMap().get("course9");
			//String course1 = respones.getResultsMap().get("course1");
			
			Toast.makeText(getApplicationContext(), course1,
					Toast.LENGTH_LONG).show();

			Intent i = new Intent(this, DisplayCourses.class);
			i.putExtra("course1",course1 );
			i.putExtra("course2",course2 );
			i.putExtra("course3",course3 );
			i.putExtra("course4",course4 );
			i.putExtra("course5",course5 );
			i.putExtra("course6",course6 );
			i.putExtra("course7",course7 );
			i.putExtra("course8",course8 );
			i.putExtra("course9",course9 );
			startActivity(i);
		}
		if (v == LevelI) {
			BPEL_Process bpelProcess = new BPEL_Process();
			BPEL_Request request = new BPEL_Request();
			String url_lib_auth = "http://lms.apiit.lk/course/index.php?categoryid=10";
			request.setUrl(url_lib_auth);

			Map<String, String> xpathMap = new HashMap<String, String>(); 
			xpathMap.put("course1","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/a[1]---");
			xpathMap.put("course2","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/a[1]---");
			xpathMap.put("course3","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[4]/div[1]/div[1]/a[1]---");
			xpathMap.put("course4","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/a[1]---");
		    xpathMap.put("course5","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[6]/div[1]/div[1]/a[1]---");
			xpathMap.put("course6","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[7]/div[1]/div[1]/a[1]---");
			xpathMap.put("course7","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[8]/div[1]/div[1]/a[1]---");
			xpathMap.put("course8","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[9]/div[1]/div[1]/a[1]---");
			xpathMap.put("course9","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[10]/div[1]/div[1]/a[1]---");
			xpathMap.put("course10","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[11]/div[1]/div[1]/a[1]---");
			xpathMap.put("course11","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[12]/div[1]/div[1]/a[1]---");
			xpathMap.put("course12","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[13]/div[1]/div[1]/a[1]---");
			xpathMap.put("course13","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[14]/div[1]/div[1]/a[1]---");
			xpathMap.put("course14","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[15]/div[1]/div[1]/a[1]---");
			xpathMap.put("course15","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[16]/div[1]/div[1]/a[1]---");
			xpathMap.put("course16","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[17]/div[1]/div[1]/a[1]---");
			xpathMap.put("course17","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[18]/div[1]/div[1]/a[1]---");
			xpathMap.put("course18","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[19]/div[1]/div[1]/a[1]---");
			xpathMap.put("course19","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[20]/div[1]/div[1]/a[1]---");
			xpathMap.put("course20","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[21]/div[1]/div[1]/a[1]---");
		
			request.setXpathMap(xpathMap);
			Map<String, String> parametersMap = new HashMap<String, String>();

			request.setParametersMap(parametersMap);
			request.setType("GET");
			BPEL_Response respones = null;
			try {
				respones = bpelProcess.doRequest(request);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			BPEL_Process bpelProcess2 = new BPEL_Process();
			BPEL_Request request2 = new BPEL_Request();
			String url_lib_auth2 = "http://lms.apiit.lk/course/index.php?categoryid=10&browse=courses&perpage=20&page=1";
			request2.setUrl(url_lib_auth2);
			
			Map<String, String> xpathMap2 = new HashMap<String, String>(); 
			xpathMap2.put("course21","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course22","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course23","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[4]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course24","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course25","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[6]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course26","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[7]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course27","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[8]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course28","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[9]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course29","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[10]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course30","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[11]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course31","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[12]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course32","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[13]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course33","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[14]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course34","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[15]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course35","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[16]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course36","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[17]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course37","/html[1]/body[1]/div[2]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[18]/div[1]/div[1]/a[1]---");

			request2.setXpathMap(xpathMap2);
			Map<String, String> parametersMap2 = new HashMap<String, String>();

			request2.setParametersMap(parametersMap2);
			request2.setType("GET");
			BPEL_Response respones2 = null;
			try {
				respones2 = bpelProcess2.doRequest(request2);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			
			String course1 = respones.getResultsMap().get("course1");
			String course2 = respones.getResultsMap().get("course2");
			String course3 = respones.getResultsMap().get("course3");
			String course4 = respones.getResultsMap().get("course4");
			String course5 = respones.getResultsMap().get("course5");
			String course6 = respones.getResultsMap().get("course6");
			String course7 = respones.getResultsMap().get("course7");
			String course8 = respones.getResultsMap().get("course8");
			String course9 = respones.getResultsMap().get("course9");
			String course10 = respones.getResultsMap().get("course10");
			String course11 = respones.getResultsMap().get("course11");
			String course12 = respones.getResultsMap().get("course12");
			String course13 = respones.getResultsMap().get("course13");
			String course14 = respones.getResultsMap().get("course14");
			String course15 = respones.getResultsMap().get("course15");
			String course16 = respones.getResultsMap().get("course16");
			String course17 = respones.getResultsMap().get("course17");
			String course18 = respones.getResultsMap().get("course18");
			String course19 = respones.getResultsMap().get("course19");
			String course20 = respones.getResultsMap().get("course20");
			String course21 = respones2.getResultsMap().get("course21");
			String course22 = respones2.getResultsMap().get("course22");
			String course23 = respones2.getResultsMap().get("course23");
			String course24 = respones2.getResultsMap().get("course24");
			String course25 = respones2.getResultsMap().get("course25");
			String course26 = respones2.getResultsMap().get("course26");
			String course27 = respones2.getResultsMap().get("course27");
			String course28 = respones2.getResultsMap().get("course28");
			String course29 = respones2.getResultsMap().get("course29");
			String course30 = respones2.getResultsMap().get("course30");
			String course31 = respones2.getResultsMap().get("course31");
			String course32 = respones2.getResultsMap().get("course32");
			String course33 = respones2.getResultsMap().get("course33");
			String course34 = respones2.getResultsMap().get("course34");
			String course35 = respones2.getResultsMap().get("course35");
			String course36 = respones2.getResultsMap().get("course36");
			String course37 = respones2.getResultsMap().get("course37");

						
			Toast.makeText(getApplicationContext(), course37,
					Toast.LENGTH_LONG).show();

			Intent i = new Intent(this, LevelICourses.class);
			i.putExtra("course1",course1 );
			i.putExtra("course2",course2 );
			i.putExtra("course3",course3 );
			i.putExtra("course4",course4 );
			i.putExtra("course5",course5 );
			i.putExtra("course6",course6 );
			i.putExtra("course7",course7 );
			i.putExtra("course8",course8 );
			i.putExtra("course9",course9 );
			i.putExtra("course10",course10 );
			i.putExtra("course11",course11 );
			i.putExtra("course12",course12 );
			i.putExtra("course13",course13 );
			i.putExtra("course14",course14 );
			i.putExtra("course15",course15 );
			i.putExtra("course16",course16 );
			i.putExtra("course17",course17 );
			i.putExtra("course18",course18 );
			i.putExtra("course19",course19 );
			i.putExtra("course20",course20 );
			i.putExtra("course21",course21 );
			i.putExtra("course22",course22 );
			i.putExtra("course23",course23 );
			i.putExtra("course24",course24 );
			i.putExtra("course25",course25 );
			i.putExtra("course26",course26 );
			i.putExtra("course27",course27 );
			i.putExtra("course28",course28 );
			i.putExtra("course29",course29 );
			i.putExtra("course30",course30 );
			i.putExtra("course31",course31 );
			i.putExtra("course32",course32 );
			i.putExtra("course33",course33 );
			i.putExtra("course34",course34 );
			i.putExtra("course35",course35 );
			i.putExtra("course36",course36 );
			i.putExtra("course37",course37 );
			startActivity(i);
		}
		if (v == LevelH) {
			BPEL_Process bpelProcess = new BPEL_Process();
			BPEL_Request request = new BPEL_Request();
			String url_lib_auth = "http://lms.apiit.lk/course/index.php?categoryid=9";
			request.setUrl(url_lib_auth);

			Map<String, String> xpathMap = new HashMap<String, String>();
			xpathMap.put("course1","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/a[1]---");
			xpathMap.put("course2","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/a[1]---");
			xpathMap.put("course3","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[4]/div[1]/div[1]/a[1]---");
			xpathMap.put("course4","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/a[1]---");
		    xpathMap.put("course5","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[6]/div[1]/div[1]/a[1]---");
			xpathMap.put("course6","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[7]/div[1]/div[1]/a[1]---");
			xpathMap.put("course7","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[8]/div[1]/div[1]/a[1]---");
			xpathMap.put("course8","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[9]/div[1]/div[1]/a[1]---");
			xpathMap.put("course9","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[10]/div[1]/div[1]/a[1]---");
			xpathMap.put("course10","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[11]/div[1]/div[1]/a[1]---");
			xpathMap.put("course11","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[12]/div[1]/div[1]/a[1]---");
			xpathMap.put("course12","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[13]/div[1]/div[1]/a[1]---");
			xpathMap.put("course13","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[14]/div[1]/div[1]/a[1]---");
			xpathMap.put("course14","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[15]/div[1]/div[1]/a[1]---");
			xpathMap.put("course15","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[16]/div[1]/div[1]/a[1]---");
			xpathMap.put("course16","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[17]/div[1]/div[1]/a[1]---");
			xpathMap.put("course17","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[18]/div[1]/div[1]/a[1]---");
			xpathMap.put("course18","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[19]/div[1]/div[1]/a[1]---");
			xpathMap.put("course19","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[20]/div[1]/div[1]/a[1]---");
			xpathMap.put("course20","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[21]/div[1]/div[1]/a[1]---");
			request.setXpathMap(xpathMap);
			Map<String, String> parametersMap = new HashMap<String, String>();

			request.setParametersMap(parametersMap);
			request.setType("GET");
			BPEL_Response respones = null;
			try {
				respones = bpelProcess.doRequest(request);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			BPEL_Process bpelProcess2 = new BPEL_Process();
			BPEL_Request request2 = new BPEL_Request();
			String url_lib_auth2 = "http://lms.apiit.lk/course/index.php?categoryid=9&browse=courses&perpage=20&page=1";
			request2.setUrl(url_lib_auth2);

			Map<String, String> xpathMap2 = new HashMap<String, String>();
			xpathMap2.put("course21","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course22","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course23","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[4]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course24","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course25","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[6]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course26","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[7]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course27","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[8]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course28","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[9]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course29","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[10]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course30","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[11]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course31","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[12]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course32","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[13]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course33","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[14]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course34","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[15]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course35","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[16]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course36","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[17]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course37","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[18]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course38","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[19]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course39","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[20]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course40","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[21]/div[1]/div[1]/a[1]---");
			request2.setXpathMap(xpathMap2);
			Map<String, String> parametersMap2 = new HashMap<String, String>();

			request2.setParametersMap(parametersMap2);
			request2.setType("GET");
			BPEL_Response respones2 = null;
			try {
				respones2 = bpelProcess2.doRequest(request2);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			String course1 = respones.getResultsMap().get("course1");
			String course2 = respones.getResultsMap().get("course2");
			String course3 = respones.getResultsMap().get("course3");
			String course4 = respones.getResultsMap().get("course4");
			String course5 = respones.getResultsMap().get("course5");
			String course6 = respones.getResultsMap().get("course6");
			String course7 = respones.getResultsMap().get("course7");
			String course8 = respones.getResultsMap().get("course8");
			String course9 = respones.getResultsMap().get("course9");
			String course10 = respones.getResultsMap().get("course10");
			String course11 = respones.getResultsMap().get("course11");
			String course12 = respones.getResultsMap().get("course12");
			String course13 = respones.getResultsMap().get("course13");
			String course14 = respones.getResultsMap().get("course14");
			String course15 = respones.getResultsMap().get("course15");
			String course16 = respones.getResultsMap().get("course16");
			String course17 = respones.getResultsMap().get("course17");
			String course18 = respones.getResultsMap().get("course18");
			String course19 = respones.getResultsMap().get("course19");
			String course20 = respones.getResultsMap().get("course20");
			String course21 = respones2.getResultsMap().get("course21");
			String course22 = respones2.getResultsMap().get("course22");
			String course23 = respones2.getResultsMap().get("course23");
			String course24 = respones2.getResultsMap().get("course24");
			String course25 = respones2.getResultsMap().get("course25");
			String course26 = respones2.getResultsMap().get("course26");
			String course27 = respones2.getResultsMap().get("course27");
			String course28 = respones2.getResultsMap().get("course28");
			String course29 = respones2.getResultsMap().get("course29");
			String course30 = respones2.getResultsMap().get("course30");
			String course31 = respones2.getResultsMap().get("course31");
			String course32 = respones2.getResultsMap().get("course32");
			String course33 = respones2.getResultsMap().get("course33");
			String course34 = respones2.getResultsMap().get("course34");
			String course35 = respones2.getResultsMap().get("course35");
			String course36 = respones2.getResultsMap().get("course36");
			String course37 = respones2.getResultsMap().get("course37");
			String course38 = respones2.getResultsMap().get("course38");
			String course39 = respones2.getResultsMap().get("course39");
			String course40 = respones2.getResultsMap().get("course40");
			
			Toast.makeText(getApplicationContext(), course2,
					Toast.LENGTH_LONG).show();

			Intent i = new Intent(this, LevelHCourses.class);
			i.putExtra("course1",course1 );
			i.putExtra("course2",course2 );
			i.putExtra("course3",course3 );
			i.putExtra("course4",course4 );
			i.putExtra("course5",course5 );
			i.putExtra("course6",course6 );
			i.putExtra("course7",course7 );
			i.putExtra("course8",course8 );
			i.putExtra("course9",course9 );
			i.putExtra("course10",course10 );
			i.putExtra("course11",course11 );
			i.putExtra("course12",course12 );
			i.putExtra("course13",course13 );
			i.putExtra("course14",course14 );
			i.putExtra("course15",course15 );
			i.putExtra("course16",course16 );
			i.putExtra("course17",course17 );
			i.putExtra("course18",course18 );
			i.putExtra("course19",course19 );
			i.putExtra("course20",course20 );
			i.putExtra("course21",course21 );
			i.putExtra("course22",course22 );
			i.putExtra("course23",course23 );
			i.putExtra("course24",course24 );
			i.putExtra("course25",course25 );
			i.putExtra("course26",course26 );
			i.putExtra("course27",course27 );
			i.putExtra("course28",course28 );
			i.putExtra("course29",course29 );
			i.putExtra("course30",course30 );
			i.putExtra("course31",course31 );
			i.putExtra("course32",course32 );
			i.putExtra("course33",course33 );
			i.putExtra("course34",course34 );
			i.putExtra("course35",course35 );
			i.putExtra("course36",course36 );
			i.putExtra("course37",course37 );
			i.putExtra("course38",course38 );
			i.putExtra("course39",course39 );
			i.putExtra("course40",course40 );
			startActivity(i);
		}
		if (v == LevelC) {
			BPEL_Process bpelProcess = new BPEL_Process();
			BPEL_Request request = new BPEL_Request();
			String url_lib_auth = "http://lms.apiit.lk/course/index.php?categoryid=6";
			request.setUrl(url_lib_auth);

			Map<String, String> xpathMap = new HashMap<String, String>();
			xpathMap.put("course1","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/a[1]---");
			xpathMap.put("course2","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/a[1]---");
			xpathMap.put("course3","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[4]/div[1]/div[1]/a[1]---");
			xpathMap.put("course4","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/a[1]---");
		    xpathMap.put("course5","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[6]/div[1]/div[1]/a[1]---");
			xpathMap.put("course6","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[7]/div[1]/div[1]/a[1]---");
			xpathMap.put("course7","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[8]/div[1]/div[1]/a[1]---");
			xpathMap.put("course8","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[9]/div[1]/div[1]/a[1]---");
			xpathMap.put("course9","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[10]/div[1]/div[1]/a[1]---");
			xpathMap.put("course10","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[11]/div[1]/div[1]/a[1]---");
			xpathMap.put("course11","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[12]/div[1]/div[1]/a[1]---");
			xpathMap.put("course12","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[13]/div[1]/div[1]/a[1]---");
			xpathMap.put("course13","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[14]/div[1]/div[1]/a[1]---");
			xpathMap.put("course14","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[15]/div[1]/div[1]/a[1]---");
			xpathMap.put("course15","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[16]/div[1]/div[1]/a[1]---");
			xpathMap.put("course16","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[17]/div[1]/div[1]/a[1]---");
			xpathMap.put("course17","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[18]/div[1]/div[1]/a[1]---");
			xpathMap.put("course18","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[19]/div[1]/div[1]/a[1]---");
			xpathMap.put("course19","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[20]/div[1]/div[1]/a[1]---");
			xpathMap.put("course20","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[21]/div[1]/div[1]/a[1]---");
			request.setXpathMap(xpathMap);
			Map<String, String> parametersMap = new HashMap<String, String>();

			request.setParametersMap(parametersMap);
			request.setType("GET");
			BPEL_Response respones = null;
			try {
				respones = bpelProcess.doRequest(request);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			BPEL_Process bpelProcess2 = new BPEL_Process();
			BPEL_Request request2 = new BPEL_Request();
			String url_lib_auth2 = "http://lms.apiit.lk/course/index.php?categoryid=6&browse=courses&perpage=20&page=1";
			request2.setUrl(url_lib_auth2);

			Map<String, String> xpathMap2 = new HashMap<String, String>();
			xpathMap2.put("course21","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course22","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course23","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[4]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course24","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[5]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course25","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[6]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course26","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[7]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course27","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[8]/div[1]/div[1]/a[1]---");
			xpathMap2.put("course28","/html[1]/body[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[9]/div[1]/div[1]/a[1]---");

			request2.setXpathMap(xpathMap2);
			Map<String, String> parametersMap2 = new HashMap<String, String>();
			request2.setParametersMap(parametersMap2);
			request2.setType("GET");
			BPEL_Response respones2 = null;
			try {
				respones2 = bpelProcess2.doRequest(request2);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			String course1 = respones.getResultsMap().get("course1");
			String course2 = respones.getResultsMap().get("course2");
			String course3 = respones.getResultsMap().get("course3");
			String course4 = respones.getResultsMap().get("course4");
			String course5 = respones.getResultsMap().get("course5");
			String course6 = respones.getResultsMap().get("course6");
			String course7 = respones.getResultsMap().get("course7");
			String course8 = respones.getResultsMap().get("course8");
			String course9 = respones.getResultsMap().get("course9");
			String course10 = respones.getResultsMap().get("course10");
			String course11 = respones.getResultsMap().get("course11");
			String course12 = respones.getResultsMap().get("course12");
			String course13 = respones.getResultsMap().get("course13");
			String course14 = respones.getResultsMap().get("course14");
			String course15 = respones.getResultsMap().get("course15");
			String course16 = respones.getResultsMap().get("course16");
			String course17 = respones.getResultsMap().get("course17");
			String course18 = respones.getResultsMap().get("course18");
			String course19 = respones.getResultsMap().get("course19");
			String course20 = respones.getResultsMap().get("course20");
			String course21 = respones2.getResultsMap().get("course21");
			String course22 = respones2.getResultsMap().get("course22");
			String course23 = respones2.getResultsMap().get("course23");
			String course24 = respones2.getResultsMap().get("course24");
			String course25 = respones2.getResultsMap().get("course25");
			String course26 = respones2.getResultsMap().get("course26");
			String course27 = respones2.getResultsMap().get("course27");
			String course28 = respones2.getResultsMap().get("course28");
			
			Toast.makeText(getApplicationContext(), course28,
					Toast.LENGTH_LONG).show();

			Intent i = new Intent(this, LevelCcourses.class);
			i.putExtra("course1",course1 );
			i.putExtra("course2",course2 );
			i.putExtra("course3",course3 );
			i.putExtra("course4",course4 );
			i.putExtra("course5",course5 );
			i.putExtra("course6",course6 );
			i.putExtra("course7",course7 );
			i.putExtra("course8",course8 );
			i.putExtra("course9",course9 );
			i.putExtra("course10",course10 );
			i.putExtra("course11",course11 );
			i.putExtra("course12",course12 );
			i.putExtra("course13",course13 );
			i.putExtra("course14",course14 );
			i.putExtra("course15",course15 );
			i.putExtra("course16",course16 );
			i.putExtra("course17",course17 );
			i.putExtra("course18",course18 );
			i.putExtra("course19",course19 );
			i.putExtra("course20",course20 );
			i.putExtra("course21",course21 );
			i.putExtra("course22",course22 );
			i.putExtra("course23",course23 );
			i.putExtra("course24",course24 );
			i.putExtra("course25",course25 );
			i.putExtra("course26",course26 );
			i.putExtra("course27",course27 );
			i.putExtra("course28",course28 );
			startActivity(i);
		}
		if (v == postgraduate) {
			BPEL_Process bpelProcess = new BPEL_Process();
			BPEL_Request request = new BPEL_Request();
			String url_lib_auth = "http://lms.apiit.lk/course/index.php?categoryid=11";
			request.setUrl(url_lib_auth);

			Map<String, String> xpathMap = new HashMap<String, String>();
			xpathMap.put("course1","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course2","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[2]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course3","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[3]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course4","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[4]/div[1]/h3[1]/a[1]---");
		    xpathMap.put("course5","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[5]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course6","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[6]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course7","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[7]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course8","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[8]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course9","---");
			xpathMap.put("course10","---");
			xpathMap.put("course11","---");
			xpathMap.put("course12","---");
			xpathMap.put("course13","---");
			xpathMap.put("course14","---");
			xpathMap.put("course15","---");
			xpathMap.put("course16","---");
			xpathMap.put("course17","---");
			xpathMap.put("course18","---");
			xpathMap.put("course19","---");
			xpathMap.put("course20","---");
			xpathMap.put("course21","---");
			xpathMap.put("course22","---");
			xpathMap.put("course23","---");
			xpathMap.put("course24","---");
			xpathMap.put("course25","---");
			xpathMap.put("course26","---");
			xpathMap.put("course27","---");
			xpathMap.put("course28","---");
			xpathMap.put("course29","---");
			xpathMap.put("course30","---");
			xpathMap.put("course31","---");
			xpathMap.put("course32","---");
			xpathMap.put("course33","---");
			xpathMap.put("course34","---");
			xpathMap.put("course35","---");
			xpathMap.put("course36","---");
			xpathMap.put("course37","---");
			xpathMap.put("course38","---");
			xpathMap.put("course39","---");
			xpathMap.put("course40","---");
			xpathMap.put("course41","---");
			xpathMap.put("course42","---");
			xpathMap.put("course43","---");
			xpathMap.put("course44","---");
			xpathMap.put("course45","---");
			xpathMap.put("course46","---");
			xpathMap.put("course47","---");
			xpathMap.put("course48","---");
			xpathMap.put("course49","---");
			xpathMap.put("course50","---");
			request.setXpathMap(xpathMap);
			Map<String, String> parametersMap = new HashMap<String, String>();

			request.setParametersMap(parametersMap);
			request.setType("GET");
			BPEL_Response respones = null;
			try {
				respones = bpelProcess.doRequest(request);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			String testResult = respones.getResultsMap().get("course1");
			
			Toast.makeText(getApplicationContext(), testResult,
					Toast.LENGTH_LONG).show();

			Intent i = new Intent(this, DisplayCourses.class);
			startActivity(i);
		}
		if (v == Miscellaneous) {
			BPEL_Process bpelProcess = new BPEL_Process();
			BPEL_Request request = new BPEL_Request();
			String url_lib_auth = "http://lms.apiit.lk/course/index.php?categoryid=11";
			request.setUrl(url_lib_auth);

			Map<String, String> xpathMap = new HashMap<String, String>();
			xpathMap.put("course1","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course2","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[2]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course3","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[3]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course4","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[4]/div[1]/h3[1]/a[1]---");
		    xpathMap.put("course5","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[5]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course6","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[6]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course7","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[7]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course8","/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[8]/div[1]/h3[1]/a[1]---");
			xpathMap.put("course9","---");
			xpathMap.put("course10","---");
			xpathMap.put("course11","---");
			xpathMap.put("course12","---");
			xpathMap.put("course13","---");
			xpathMap.put("course14","---");
			xpathMap.put("course15","---");
			xpathMap.put("course16","---");
			xpathMap.put("course17","---");
			xpathMap.put("course18","---");
			xpathMap.put("course19","---");
			xpathMap.put("course20","---");
			xpathMap.put("course21","---");
			xpathMap.put("course22","---");
			xpathMap.put("course23","---");
			xpathMap.put("course24","---");
			xpathMap.put("course25","---");
			xpathMap.put("course26","---");
			xpathMap.put("course27","---");
			xpathMap.put("course28","---");
			xpathMap.put("course29","---");
			xpathMap.put("course30","---");
			xpathMap.put("course31","---");
			xpathMap.put("course32","---");
			xpathMap.put("course33","---");
			xpathMap.put("course34","---");
			xpathMap.put("course35","---");
			xpathMap.put("course36","---");
			xpathMap.put("course37","---");
			xpathMap.put("course38","---");
			xpathMap.put("course39","---");
			xpathMap.put("course40","---");
			xpathMap.put("course41","---");
			xpathMap.put("course42","---");
			xpathMap.put("course43","---");
			xpathMap.put("course44","---");
			xpathMap.put("course45","---");
			xpathMap.put("course46","---");
			xpathMap.put("course47","---");
			xpathMap.put("course48","---");
			xpathMap.put("course49","---");
			xpathMap.put("course50","---");
			request.setXpathMap(xpathMap);
			Map<String, String> parametersMap = new HashMap<String, String>();

			request.setParametersMap(parametersMap);
			request.setType("GET");
			BPEL_Response respones = null;
			try {
				respones = bpelProcess.doRequest(request);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			String testResult = respones.getResultsMap().get("course1");
			
			Toast.makeText(getApplicationContext(), testResult,
					Toast.LENGTH_LONG).show();

			Intent i = new Intent(this, DisplayCourses.class);
			startActivity(i);
		}

	}

}
